﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Data.Entity;
using System.Timers;
using Wicresoft.Task.Common;
using Microsoft.TeamFoundation.VersionControl.Client;

namespace Wicresoft.Task.TFSAutoNotify
{
    class Program
    {

        static void Main()
        {
            LogRunInfo.Ready();
            System.Timers.Timer timesDo = new System.Timers.Timer(60 * 1000);
            timesDo.Interval = 10 * 1000;
            timesDo.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent);
            timesDo.AutoReset = true;
            timesDo.Enabled = true;
            timesDo.Start();
            GC.KeepAlive(timesDo);
            while (true)
            {
                Console.Read();
            }
        }


        private static void OnTimedEvent(object source, ElapsedEventArgs e)
        {
            Console.WriteLine("The TFSAutoNotify event was raised at {0}", e.SignalTime);
            AutoNotify.Notify();
        }
    }
}
